﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DLL.WebColumn
{
	/// <summary>
	/// 栏目实体类
	/// </summary>
	/// <![CDATA[2014-8-1 15:41:48]]>
	public class Entity : EntityBase
	{
		#region 属性
		private Config clsConfig = new Config();
		public string strColumnName = "";		// 栏目名称
		public int nParentID = 0;		// 栏目上级栏目ID
		public int nGrade = 0;		// 栏目等级
		public int nOrder = 0;		// 栏目显示顺序
		public int nInherit;		// 是否继承上级栏目权限

		private string strParentName = "";		// 上级栏目名称
		//private string strInherit = "";		// 是否继承上级栏目权限名称
		#endregion 属性

		#region Get、Set属性
		/// <summary>
		/// 栏目名称
		/// </summary>
		/// <![CDATA[2014-8-1 15:44:07]]>
		public string ColumnName
		{
			get { return strColumnName; }
			set { strColumnName = value.Trim(); }
		}
		/// <summary>
		/// 栏目上级栏目ID
		/// </summary>
		/// <![CDATA[2014-8-1 15:44:40]]>
		public int ParentID
		{
			get { return nParentID; }
			set { nParentID = value; }
		}
		/// <summary>
		/// 栏目类别
		/// </summary>
		/// <![CDATA[2014-8-1 15:45:41]]>
		public int Grade
		{
			get { return nGrade; }
			set { nGrade = value; }
		}
		/// <summary>
		/// 上级栏目名称
		/// </summary>
		/// <![CDATA[2014-8-9 11:29:10]]>
		public string ParentName
		{
			get { return strParentName; }
			set { strParentName = value.Trim(); }
		}
		/// <summary>
		/// 栏目显示顺序
		/// </summary>
		/// <![CDATA[2014-8-10 16:40:29]]>
		public int Order
		{
			get { return nOrder; }
			set { nOrder = value; }
		}
		/// <summary>
		/// 栏目是否继承上级栏目权限
		/// </summary>
		/// <![CDATA[2014-8-13 15:14:31]]>
		public bool Inherit
		{
			get
			{
				if (nInherit == clsConfig.nColumn_Inherit)
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			set
			{
				if (value)
				{
					nInherit = clsConfig.nColumn_Inherit;
				}
				else
				{
					nInherit = clsConfig.nColumn_NoInherit;
				}
			}
		}
		/// <summary>
		/// 是否继承上级栏目字符串
		/// </summary>
		/// <![CDATA[2014-8-13 15:21:02]]>
		public string InheritName
		{
			get
			{
				if (nInherit == clsConfig.nColumn_Inherit)
				{
					return clsConfig.strColumn_Inherit;
				}
				else
				{
					return clsConfig.strColumn_NoInHerit;
				}
			}
		}
		#endregion Get、Set属性

		#region 构造函数
		/// <summary>
		/// 栏目实体类构造函数
		/// </summary>
		/// <![CDATA[2014-8-1 15:41:48]]>
		public Entity()
			: base()
		{
			nInherit = clsConfig.nColumn_Inherit;
		}
		#endregion 构造函数
	}
}
